// 定义一个混入对象 
import { mapState } from 'vuex'
var dictionariesMixin = {
    computed: {
        ...mapState(["count"])
    },
    created: function () {
        this.getDictionaries()
    },
    methods: {
        //获取字典的数据
        getDictionaries: function () {
            let count = this.count;
            console.log('state', this.count)
            console.log('mixin 操作:', this.$store.state)
            count++;
            console.log('count的值：', count)
        }
    }
}
export { dictionariesMixin }

/**
 * 解析
 *  获取state的方法：
         this.$store.state.count
 *     或是：
        import { mapState } from 'vuex'
        computed: {
            ...mapState(["count"])
        },
        console.log('state', this.count)
 */
